﻿using System;
using System.Collections.Generic;
using System.Text;
using Toyger.Common.Connections;
using Toyger.Common.UI;
using Toyger.Common.Interfaces;

namespace Toyger.Common.PlugIn.SqlServer2005
{
   public class SqlServer2005:IDBManager
    {
        #region IDBManager Members

       public IConnectionEditor GetConnEditor(Toyger.Common.Connections.ConnectionObject cObj)
        {
            return new ConnEditor_Sql2005(cObj);
        }

        public ConnectionSession NewSession(ConnectionObject cObj)
        {
            throw new NotImplementedException();
        }

        public Toyger.Common.UI.ConnObjPane GetConnObjPane(Toyger.Common.Connections.ConnectionObject cObj, IController controller)
        {
            return ConnObjPane.GetInstance(cObj, this, controller);
        }


       /// <summary>
       /// Create a defaull <c>ConnectionObject</c> for SqlServer 2005.
       /// </summary>
       /// <returns></returns>
        public ConnectionObject CreateDefaultConnectionObject()
        {
            ConnectionObject co = ConnectionObject.CreateConnectionObject("an empty sql server","",SqlServer2005Prop.Default.PropTypename);
            co.CustomerProperties.Add(SqlServer2005Prop.Default.PropLoginname, "");
            co.CustomerProperties.Add(SqlServer2005Prop.Default.PropPassword, "");
            co.CustomerProperties.Add(SqlServer2005Prop.Default.PropIntergrated, "false");
            return co;
        }

        #endregion
    }
}
